package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the PAY_TABLE database table.
 * 
 */
@Entity
@Table(name="PAY_TABLE")
@NamedQuery(name="PayTable.findAll", query="SELECT p FROM PayTable p")
public class PayTable implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String payid;

	private String admini;

	private String office2;

	private String patientname2;

	private BigDecimal payamount;

	@Temporal(TemporalType.DATE)
	private Date paytime;

	private String paytype;

	//bi-directional many-to-one association to LiveinrecordTable
	@ManyToOne
	@JoinColumn(name="LIVEID8")
	private LiveinrecordTable liveinrecordTable;

	//bi-directional many-to-one association to TallyTable
	@OneToMany(mappedBy="payTable")
	private List<TallyTable> tallyTables;

	public PayTable() {
	}

	public String getPayid() {
		return this.payid;
	}

	public void setPayid(String payid) {
		this.payid = payid;
	}

	public String getAdmini() {
		return this.admini;
	}

	public void setAdmini(String admini) {
		this.admini = admini;
	}

	public String getOffice2() {
		return this.office2;
	}

	public void setOffice2(String office2) {
		this.office2 = office2;
	}

	public String getPatientname2() {
		return this.patientname2;
	}

	public void setPatientname2(String patientname2) {
		this.patientname2 = patientname2;
	}

	public BigDecimal getPayamount() {
		return this.payamount;
	}

	public void setPayamount(BigDecimal payamount) {
		this.payamount = payamount;
	}

	public Date getPaytime() {
		return this.paytime;
	}

	public void setPaytime(Date paytime) {
		this.paytime = paytime;
	}

	public String getPaytype() {
		return this.paytype;
	}

	public void setPaytype(String paytype) {
		this.paytype = paytype;
	}

	public LiveinrecordTable getLiveinrecordTable() {
		return this.liveinrecordTable;
	}

	public void setLiveinrecordTable(LiveinrecordTable liveinrecordTable) {
		this.liveinrecordTable = liveinrecordTable;
	}

	public List<TallyTable> getTallyTables() {
		return this.tallyTables;
	}

	public void setTallyTables(List<TallyTable> tallyTables) {
		this.tallyTables = tallyTables;
	}

	public TallyTable addTallyTable(TallyTable tallyTable) {
		getTallyTables().add(tallyTable);
		tallyTable.setPayTable(this);

		return tallyTable;
	}

	public TallyTable removeTallyTable(TallyTable tallyTable) {
		getTallyTables().remove(tallyTable);
		tallyTable.setPayTable(null);

		return tallyTable;
	}

}